<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>维修工单</title>
		<!-- 引入样式 -->
		<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
		<script src="../js/vue.js"></script>
		<!-- 引入组件库 -->
		<script src="https://unpkg.com/element-ui/lib/index.js"></script>
		<script src="../js/axios.js"></script>
		<script src="../js/qs.js"></script>
		<script src="../js/jquery.min.js"></script>
		<style type="text/css">
			a:hover{
				cursor: pointer;
				color: #DD0000;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<!-- 
			<div style="margin-left: 15px;" id="app1">
				<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
					<el-menu-item index="1">全部</el-menu-item>
					<el-menu-item index="2">维修工单</el-menu-item>
				</el-menu>
			</div> 
			-->
			<div style="width: 100%;margin-left: 15px;margin-top: 20px;display: block;" id="app2">
				<i class="el-icon-caret-right" style="line-height: 40px;margin-right: 5px; float: left;"></i>
				<template style="margin-top: 50px;">
					<el-select v-model="selectValue" @change="getSelectRepairInfo()" filterable placeholder="全部数据" style="float: left;width: 120px; height: 60px;margin-top: -3px;">
						<el-option v-for="item in allrepairoptions" :key="item.value" :label="item.label" :value="item.value">
						</el-option>
					</el-select>
				</template>
				<i class="el-icon-search" style="line-height: 40px;float: left;margin-left: 10px; width: 50px; height: 50px;"></i>
				<!-- 搜索框 -->
				<div style="display: block;margin-left: -20px;float: left;margin-top: -4px;">
					<el-input style="width: 200px;cursor: pointer;" placeholder="" v-model="gdID">
						<el-button slot="append" @click="searchgdId()" style="width: 80px;">工单号</el-button>
					</el-input>
				</div>
			</div>
			<!-- 表单 -->
			<div style="width: 100%;float: left;" id="app3">
				<div style="float: left;margin-left: 30px;">
					<p style="font-size: 13px;color: #333333;height: 30px;">维修工单<!-- <a style="font-size: 12px;color: #807E7E;">&nbsp;共{{getNewPage.total}}条</a> --></p>
				</div>
				<div style="margin-right: 20px;">
					<!-- 新建维修工单 -->
					<el-button size="small" icon="el-icon-circle-plus" @click="getNew()" style="width: 80px;float: right;margin-top:-10px;">&nbsp;新建</el-button>
					<!-- Form -->
					<el-dialog title="新建维修工单" :visible.sync="dialogFormVisible" width="70%" append-to-body>
						<hr style="border: 0.5px solid #666666;margin: -15px 0px 15px;" />
						<p style="font-size: 15px;color: #807E7E;margin: 10px 0px 15px 0px;">单号与接收</p>
						<hr style="border: 0.5px solid #EEEEEE;margin-bottom: 25px;" />
						<el-form :model="repform" :rules="reprules" ref="repform" label-width="100px" class="demo-repform" style="height:1100px;">
							<el-row style="margin-left: -10px;">
								<el-col :span="12">
									<el-form-item label="接单人">
										<el-select v-model="repform.getPerson" clearable filterable="" style="width: 100%;" remote="" reserve-keyword placeholder="请输入关键词" :remote-method="firstmanMethod" :loading="cumloading">
												<i slot="prefix" class="el-input__icon el-icon-search"></i>
												<el-option v-for="item in firsgettman" :key="item.value" :label="item.label" :value="item.value"></el-option>
											</el-select>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="接件日期">
										<el-date-picker v-model="repform.gettoday" align="right" value-format="yyyy-MM-dd" type="date" style="width: 100%;" placeholder="请选择" :picker-options="pickerOptions1">
										</el-date-picker>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left: -10px;">
								<el-col :span="12">
									<el-form-item label="对应客户" prop="custid" required>
										<el-select v-model="repform.custid"  @clear="comcustidto()" @change="selectOnechange()" clearable filterable="" style="width: 100%;" remote="" reserve-keyword placeholder="请输入关键词" :remote-method="cumremoteMethod" :loading="cumloading" hide-loading>
											<i slot="prefix" class="el-input__icon el-icon-search"></i>
											<el-option v-for="item in customer" :key="item.value" :label="item.label" :value="item.value"></el-option>
								 		</el-select>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="接件时间">
										<el-time-picker v-model="repform.gettime" value-format="HH:mm:dd" placeholder="请选择" style="width: 100%;" :picker-options="{selectableRange: '7:00:00 - 20:00:00'}" >
										</el-time-picker>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left: -10px;">
								<el-col :span="12">
									<el-form-item label="客户电话">
										<el-input v-model="repform.phone" clearable></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="联系人">
										<el-select v-model="repform.contactid" clearable style="width: 100%;"
										 remote="" reserve-keyword placeholder="请选择" @clear="comcontidto()" @change="addothercon" :remote-method="contactidMethod" :loading="cumloading">
											<i slot="prefix" class="el-input__icon el-icon-search"></i>
											<el-option v-for="item in allcontact" :key="item.value" :label="item.label" :value="item.value"></el-option>
										</el-select>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left: -10px;">
								<el-col :span="12">
									<el-form-item label="联系人电话">
										<el-input v-model="repform.reptel" clearable></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="分类">
										<span>
											<el-select v-model="repform.gdchlassity" clearable style="width: 100%;"
											 remote="" reserve-keyword placeholder="请选择" :remote-method="gdchlassityMethod" :loading="cumloading">
												<i slot="prefix" class="el-input__icon el-icon-search"></i>
												<el-option v-for="item in allgdchlassity" :key="item.value" :label="item.label" :value="item.value"></el-option>
											</el-select>
											<!-- <el-tooltip content="Bottom center" placement="bottom">
												<div slot="content">数据字典</div>
												<i class="el-icon-document" id="newtool"></i>
											</el-tooltip> -->
										</span>
									</el-form-item>
								</el-col>
							</el-row>
							<hr style="border: 0.5px solid #EEEEEE;margin-top: 15px;" />
							<p style="font-size: 15px;color: #333333;margin: 15px 0px 15px 0px;">接件详情</p>
							<hr style="border: 0.5px solid #EEEEEE;" />
							<hr style="border: 0.5px solid #333333;margin: 20px 0px 35px 0px;" />
							<el-row style="margin-left: -8px;">
								<el-col :span="12">
									<el-form-item label="产品订单" prop="allorders" required>
										<template>
											<el-select v-model="repform.allorders" @clear="comallordersto()" @change="selectAllorders()" clearable style="width: 98%;" placeholder="请选择" :remote-method="getOrdersMethod" :loading="cumloading">
												<i slot="prefix" class="el-input__icon el-icon-search"></i>
												<el-option v-for="item in allproOrders" :key="item.value" :label="item.label" :value="item.value">
												</el-option>
											</el-select>
										</template>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="维修产品" prop="proID" required>
										<el-select v-model="repform.proID" clearable style="width: 100%;"
										 remote="" reserve-keyword placeholder="请选择" @change="addDate" :remote-method="productidMethod" :loading="cumloading">
											<i slot="prefix" class="el-input__icon el-icon-search"></i>
											<el-option v-for="item in proIDoptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
										</el-select>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left: -8px;">
								<el-col :span="12">
									<el-form-item label="维修人" prop="getman">
										<el-select v-model="repform.getman" clearable style="width: 98%;"
										 remote="" reserve-keyword placeholder="请选择" :remote-method="getmanMethod" :loading="cumloading">
											<i slot="prefix" class="el-input__icon el-icon-search"></i>
											<el-option v-for="item in getmanoptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
										</el-select>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="产品销售日期">
										<el-date-picker v-model="repform.prosalettoday" style="width: 99%;" align="right" value-format="yyyy-MM-dd" type="date" placeholder="请选择" :picker-options="pickerOptions1">
										</el-date-picker>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left:-8px">
							<el-col :span="12">
									<el-form-item label="维修工单进度">
										<template>
											<el-select v-model="repform.alljindu" disabled style="width: 86%;" placeholder="接件" :remote-method="getJInduMethod">
												<i slot="prefix" class="el-input__icon el-icon-search"></i>
												<el-option v-for="item in alljinduoptions" :key="item.value" :label="item.label" :value="item.value">
												</el-option>
											</el-select>
										</template>
										<a href="#" @click="centerDialogVisible = true" style="font-size: 12px;cursor: pointer;color: #999999;">说明</a>
												<el-dialog title="维修进度提示" :visible.sync="centerDialogVisible" width="30%" height="100px" append-to-body style="color: #EBEFF2;">
													<hr style="border: 0.5px solid #A8A297;margin-top: -30px;" />
													<p style="font-size: 14px;color: #000000;margin-bottom: 5px;">关于维修进度</p>
													<p style="font-size: 13px;color: #F43838;"> 接件→客户确认→开始维修→维修完成</p>
													<p slot="footer" class="dialog-footer">
														<el-button @click="centerDialogVisible = false" style="text-align: center;margin-top: -35px;">关 闭</el-button>
													</p>
												</el-dialog>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="保修">
										<template>
											<el-radio @change="chooseProOne" v-model="repform.radioguarantee" :label="1261">在保</el-radio>
											<el-radio @change="chooseProOne" v-model="repform.radioguarantee" :label="1262">出保</el-radio>
										</template>

									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left: -8px;">
								<el-col :span="24">
									<el-form-item label="故障描述">
										<el-input type="textarea" :autosize="{ minRows: 1 }" placeholder="请输入内容" v-model="repform.texterrorDescription">
										</el-input>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left: -8px;">
								<el-col :span="24">
									<el-form-item label="沟通/注意">
										<el-input type="textarea" :autosize="{ minRows: 1 }" placeholder="请输入内容" v-model="repform.textcommunication"
										 style="margin-right: -50px;"></el-input>
									</el-form-item>
								</el-col>
							</el-row>

							<hr style="border: 0.5px solid #EEEEEE;margin-top: 15px;" />
							<p style="font-size: 15px;color: #333333;margin: 20px 0px 15px 0px;">费用与执行</p>
							<hr style="border: 0.5px solid #EEEEEE;margin-top: 15px;margin-bottom: 15px;" />
							<hr style="border: 0.5px solid #333333;margin: 20px 0px 35px 0px;" />
							
							<el-row style="margin-left: -10px;" id="prodisable">
								<el-col :span="12">
									<el-form-item label="费用">
										<el-input v-model="repform.rocost" placeholder="0.00" clearable></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="已收款">
										<el-input v-model="repform.hasgetcost" placeholder="0.00" clearable></el-input>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row style="margin-left: -10px;">
								<el-col :span="12">
									<el-form-item label="状态" prop="radiostatus" required>
										<template>
											<el-radio v-model="repform.radiostatus" :label="1264">执行中</el-radio>
											<el-radio v-model="repform.radiostatus" :label="1265">结束</el-radio>
											<el-radio v-model="repform.radiostatus" :label="1266">意外终止</el-radio>
										</template>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="约定交付日期">
										<el-date-picker v-model="repform.paytoday" style="width: 100%;" align="right" value-format="yyyy-MM-dd" type="date" placeholder="请选择" :picker-options="pickerOptions">
										</el-date-picker>
									</el-form-item>
								</el-col>
							</el-row>
							<!-- <el-row style="margin-left: -10px;">
								<el-col :span="24">
									<el-form-item label="毛利">
										<el-input v-model="repform.roprofit" disabled placeholder="¥0.00"></el-input>
									</el-form-item>
								</el-col>
							</el-row> -->
							<el-row style="margin-left: -10px;">
								<el-col :span="24">
									<el-form-item label="备注">
										<el-input type="textremark" :autosize="{ minRows: 1 }" placeholder="" v-model="repform.remark"></el-input>
									</el-form-item>
								</el-col>
							</el-row>
							<el-form-item style="float: right;margin-top: 40px;">
								<el-button @click="dialogFormVisible = false">取 消</el-button>
								<el-button type="primary" @click="submitForm('repform')">确定</el-button>
								<!-- <el-button @click="resetForm('repform')">重置</el-button> -->
							</el-form-item>
						</el-form>
					</el-dialog>

				</div>
			</div>


			<!-- 表单 -->
			<div id="app4" style="margin-left: 10px;margin-top: 10px;">
				<template>
					<el-table ref="multipleTable" tooltip-effect="dark" @selection-change="handleSelectionChange" :data="repairtable"
					 border style="width: 100%;color: black;">
						<el-table-column type="selection" width="35" align="center">
						</el-table-column>
						<el-table-column prop="ID" show-overflow-tooltip label="ID" width="100" align="center">
						</el-table-column>
						<el-table-column prop="theme" show-overflow-tooltip label="主题" align="center">
						</el-table-column>
						<el-table-column prop="custName" show-overflow-tooltip label="对应客户" align="center">
						</el-table-column>
						<el-table-column prop="cost" show-overflow-tooltip label="费用" align="center">
						</el-table-column>
						<!-- <el-table-column prop="getCost" show-overflow-tooltip label="已收款" align="center">
						</el-table-column> -->
						<el-table-column prop="scheduleName" show-overflow-tooltip label="状态" align="center">
						</el-table-column>
						<el-table-column prop="getpersonName" show-overflow-tooltip label="接单人" align="center">
						</el-table-column>
						<el-table-column prop="workerName" show-overflow-tooltip label="维修人" align="center">
						</el-table-column>
						<!-- <el-table-column prop="profile" show-overflow-tooltip label="毛利" align="center">
						</el-table-column> -->
						<el-table-column fixed="right" label="操作" width="110" align="center">
							<template slot-scope="scope">
								<el-tooltip content="Bottom center" placement="bottom">
									<div slot="content">删除</div>
									<i class="el-icon-delete" @click="deletenew(scope.row.ID)" style="font-size: 17px;"></i>
								</el-tooltip>
								<el-dialog title="提示" :visible.sync="dialogDelete" width="30%" append-to-body >
					 	 			<span>你确定要删除吗？</span>
						  				<span slot="footer" class="dialog-footer">
						   				<el-button @click="dialogDelete = false">取 消</el-button>
						   				<el-button type="primary" @click="dialogDelete = false" v-on:click="Delete" >确 定</el-button>
					 				</span>
								</el-dialog>
								<el-tooltip content="Bottom center" placement="bottom">
									<div slot="content">编辑</div>
									<i class="el-icon-edit" @click="updatehandleClick(scope.row)" style="font-size: 17px;"></i>
								</el-tooltip>
								<!-- 编辑维修工单遮罩层  -->
									<el-dialog title="编辑维修工单" :visible.sync="dialogFormVisible" width="70%" append-to-body>
										<hr style="border: 0.5px solid #666666;margin: -15px 0px 15px;" />
										<p style="font-size: 15px;color: #807E7E;margin: 10px 0px 15px 0px;">单号与接收</p>
										<hr style="border: 0.5px solid #EEEEEE;margin-bottom: 25px;" />
										<!-- Form -->
										 <el-form :model="repform" :rules="reprules" ref="repform" label-width="100px" class="demo-repform" style="height: 1150px; margin-top: 50px;">
											  <el-row style="margin-left: -10px;">
												<el-col :span="12">
													<el-form-item label="接单人">
														<el-select v-model="repform.getPerson" clearable filterable="" style="width: 100%;" remote="" reserve-keyword placeholder="请输入关键词" :remote-method="firstmanMethod" :loading="cumloading">
																<i slot="prefix" class="el-input__icon el-icon-search"></i>
																<el-option v-for="item in firsgettman" :key="item.value" :label="item.label" :value="item.value"></el-option>
															</el-select>
													</el-form-item>
												</el-col>
												<el-col :span="12">
													<el-form-item label="接件日期">
														<el-date-picker v-model="repform.gettoday" align="right" value-format="yyyy-MM-dd" type="date" style="width: 100%;" placeholder="请选择" :picker-options="pickerOptions1">
														</el-date-picker>
													</el-form-item>
												</el-col>
											</el-row>
											<el-row style="margin-left: -10px;">
												<el-col :span="12">
													<el-form-item label="对应客户" prop="custid" required>
														<el-select v-model="repform.custid"  @clear="comcustidto()" @change="selectOnechange()" clearable filterable="" style="width: 100%;" remote="" reserve-keyword placeholder="请输入关键词" :remote-method="cumremoteMethod" :loading="cumloading" hide-loading>
															<i slot="prefix" class="el-input__icon el-icon-search"></i>
															<el-option v-for="item in customer" :key="item.value" :label="item.label" :value="item.value"></el-option>
												 		</el-select>
													</el-form-item>
												</el-col>
												<el-col :span="12">
													<el-form-item label="接件时间">
														<el-time-picker v-model="repform.gettime" placeholder="请选择" style="width: 100%;" :picker-options="{selectableRange: '7:00:00 - 20:00:00'}" value-format="HH:mm:dd">
														</el-time-picker>
													</el-form-item>
												</el-col>
											</el-row>
											<el-row style="margin-left: -10px;">
												<el-col :span="12">
													<el-form-item label="客户电话">
														<el-input v-model="repform.phone" clearable></el-input>
													</el-form-item>
												</el-col>
												<el-col :span="12">
													<el-form-item label="联系人">
														<el-select v-model="repform.contactid" clearable style="width: 100%;"
														 remote="" reserve-keyword placeholder="请选择" @clear="comcontidto()" @change="addothercon" :remote-method="contactidMethod" :loading="cumloading">
															<i slot="prefix" class="el-input__icon el-icon-search"></i>
															<el-option v-for="item in allcontact" :key="item.value" :label="item.label" :value="item.value"></el-option>
														</el-select>
													</el-form-item>
												</el-col>
											</el-row>
											<el-row style="margin-left: -10px;">
												<el-col :span="12">
													<el-form-item label="联系人电话">
														<el-input v-model="repform.reptel" clearable></el-input>
													</el-form-item>
												</el-col>
												<el-col :span="12">
													<el-form-item label="分类">
														<span>
															<el-select v-model="repform.gdchlassity" clearable style="width: 100%;"
															 remote="" reserve-keyword placeholder="请选择" :remote-method="gdchlassityMethod" :loading="cumloading">
																<i slot="prefix" class="el-input__icon el-icon-search"></i>
																<el-option v-for="item in allgdchlassity" :key="item.value" :label="item.label" :value="item.value"></el-option>
															</el-select>
															<!-- <el-tooltip content="Bottom center" placement="bottom">
																<div slot="content">数据字典</div>
																<i class="el-icon-document" id="newtool"></i>
															</el-tooltip> -->
														</span>
													</el-form-item>
												</el-col>
											</el-row>
											<hr style="border: 0.5px solid #EEEEEE;margin-top: 15px;" />
											<p style="font-size: 15px;color: #333333;margin: 15px 0px 15px 0px;">接件详情</p>
											<hr style="border: 0.5px solid #EEEEEE;" />
											<hr style="border: 0.5px solid #333333;margin: 20px 0px 35px 0px;" />
											<el-row style="margin-left: -8px;">
													<el-col :span="12">
														<el-form-item label="产品订单" prop="allorders" required>
															<template>
																<el-select v-model="repform.allorders" @clear="comallordersto()" @change="selectAllorders()" clearable style="width: 98%;" placeholder="请选择" :remote-method="getOrdersMethod" :loading="cumloading">
																	<i slot="prefix" class="el-input__icon el-icon-search"></i>
																	<el-option v-for="item in allproOrders" :key="item.value" :label="item.label" :value="item.value">
																	</el-option>
																</el-select>
															</template>
														</el-form-item>
													</el-col>
													<el-col :span="12">
														<el-form-item label="维修产品" prop="proID" required>
															<el-select v-model="repform.proID" clearable style="width: 100%;"
															 remote="" reserve-keyword placeholder="请选择" @change="addDate" :remote-method="productidMethod" :loading="cumloading">
																<i slot="prefix" class="el-input__icon el-icon-search"></i>
																<el-option v-for="item in proIDoptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
															</el-select>
														</el-form-item>
													</el-col>
												</el-row>
												<el-row style="margin-left: -8px;">
													<el-col :span="12">
														<el-form-item label="维修人" prop="getman">
															<el-select v-model="repform.getman" clearable style="width: 98%;"
															 remote="" reserve-keyword placeholder="请选择" :remote-method="getmanMethod" :loading="cumloading">
																<i slot="prefix" class="el-input__icon el-icon-search"></i>
																<el-option v-for="item in getmanoptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
															</el-select>
														</el-form-item>
													</el-col>
													<el-col :span="12">
														<el-form-item label="产品销售日期">
															<el-date-picker v-model="repform.prosalettoday" style="width: 99%;" align="right" value-format="yyyy-MM-dd" type="date" placeholder="请选择" :picker-options="pickerOptions1">
															</el-date-picker>
														</el-form-item>
													</el-col>
												</el-row>
												<el-row style="margin-left:-8px">
												<el-col :span="12">
														<el-form-item label="维修工单进度">
															<template>
																<el-select v-model="repform.alljindu" disabled style="width: 86%;" placeholder="接件" :remote-method="getJInduMethod">
																	<i slot="prefix" class="el-input__icon el-icon-search"></i>
																	<el-option v-for="item in alljinduoptions" :key="item.value" :label="item.label" :value="item.value">
																	</el-option>
																</el-select>
															</template>
															<a href="#" @click="centerDialogVisible = true" style="font-size: 12px;cursor: pointer;color: #999999;">说明</a>
																	<el-dialog title="维修进度提示" :visible.sync="centerDialogVisible" width="30%" height="100px" append-to-body style="color: #EBEFF2;">
																		<hr style="border: 0.5px solid #A8A297;margin-top: -30px;" />
																		<p style="font-size: 14px;color: #000000;margin-bottom: 5px;">关于维修进度</p>
																		<p style="font-size: 13px;color: #F43838;"> 接件→客户确认→开始维修→维修完成</p>
																		<p slot="footer" class="dialog-footer">
																			<el-button @click="centerDialogVisible = false" style="text-align: center;margin-top: -35px;">关 闭</el-button>
																		</p>
																	</el-dialog>
														</el-form-item>
													</el-col>
													<el-col :span="12">
														<el-form-item label="保修">
															<template>
																<el-radio @change="chooseProOne" v-model="repform.radioguarantee" :label="1261">在保</el-radio>
																<el-radio @change="chooseProOne" v-model="repform.radioguarantee" :label="1262">出保</el-radio>
															</template>
					
														</el-form-item>
													</el-col>
												</el-row>
												<el-row style="margin-left: -8px;">
													<el-col :span="24">
														<el-form-item label="故障描述">
															<el-input type="textarea" :autosize="{ minRows: 1 }" placeholder="请输入内容" v-model="repform.texterrorDescription">
															</el-input>
														</el-form-item>
													</el-col>
												</el-row>
												<el-row style="margin-left: -8px;">
													<el-col :span="24">
														<el-form-item label="沟通/注意">
															<el-input type="textarea" :autosize="{ minRows: 1 }" placeholder="请输入内容" v-model="repform.textcommunication"
															 style="margin-right: -50px;"></el-input>
														</el-form-item>
													</el-col>
												</el-row>
				
											<hr style="border: 0.5px solid #EEEEEE;margin-top: 15px;" />
											<p style="font-size: 15px;color: #333333;margin: 20px 0px 15px 0px;">费用与执行</p>
											<hr style="border: 0.5px solid #EEEEEE;margin-top: 15px;margin-bottom: 15px;" />
											<hr style="border: 0.5px solid #333333;margin: 20px 0px 35px 0px;" />
											
											<el-row style="margin-left: -10px;">
												<el-col :span="12">
													<el-form-item label="费用">
														<el-input v-model="repform.rocost" placeholder="0.00" clearable></el-input>
													</el-form-item>
												</el-col>
												<el-col :span="12">
													<el-form-item label="已收款">
														<el-input v-model="repform.hasgetcost" placeholder="0.00" clearable></el-input>
													</el-form-item>
												</el-col>
											</el-row>
											<el-row style="margin-left: -10px;">
												<el-col :span="12">
													<el-form-item label="状态" prop="radiostatus" required>
														<template>
															<el-radio v-model="repform.radiostatus" :label="1264">执行中</el-radio>
															<el-radio v-model="repform.radiostatus" :label="1265">结束</el-radio>
															<el-radio v-model="repform.radiostatus" :label="1266">意外终止</el-radio>
														</template>
													</el-form-item>
												</el-col>
												<el-col :span="12">
													<el-form-item label="约定交付日期">
														<el-date-picker v-model="repform.paytoday" style="width: 100%;" align="right" value-format="yyyy-MM-dd" type="date" placeholder="请选择" :picker-options="pickerOptions">
														</el-date-picker>
													</el-form-item>
												</el-col>
											</el-row>
											<!-- <el-row style="margin-left: -10px;">
												<el-col :span="24">
													<el-form-item label="毛利">
														<el-input v-model="repform.roprofit" disabled placeholder="¥0.00"></el-input>
													</el-form-item>
												</el-col>
											</el-row> -->
											<el-row style="margin-left: -10px;">
												<el-col :span="24">
													<el-form-item label="备注">
														<el-input type="textremark" :autosize="{ minRows: 1 }" placeholder="" v-model="repform.remark"></el-input>
													</el-form-item>
												</el-col>
											</el-row>
											<el-form-item style="float: right;margin-top: 30px;">
												<el-button @click="dialogFormVisible = false">取 消</el-button>
												<el-button type="primary" @click="submitForm('repform')">确定</el-button>
												<!-- <el-button @click="resetForm('repform')">重置</el-button> -->
											</el-form-item>  
										</el-form>
									</el-dialog>
									
								<el-tooltip content="Bottom center" placement="bottom">
									<div slot="content">查看</div>
									<i class="el-icon-document" @click="openrepairView(scope.row)" style="font-size: 17px;"></i>
								</el-tooltip>
								
								
							</template>
						</el-table-column>
					</el-table>
					<div style="margin-top: 10px">
						<div style="display: block; float: left;margin-left: 5px;">
							<!-- <el-tooltip content="Bottom center" placement="bottom">
								<div slot="content">删除</div>
								<i class="el-icon-delete" style="margin: 8px;font-size: 17px;"></i>
							</el-tooltip> -->
						</div>
						<!-- 分页 -->
						<div style="display: block; float: left; margin-left: 20%;">
							<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage4" :pager-count="5"  
							 :page-sizes="[4, 6, 10, 20]" :page-size="${page.pageSize}" layout="total, sizes, prev, pager, next, jumper" :total="pages.total">
							</el-pagination>
						</div>
						<div style="display: block; float: right;margin-right: 3%;">
						<!-- 	<el-tooltip content="Bottom center" placement="bottom">
								<div slot="content">打印</div>
								<el-button circle size="mini"><i class="el-icon-printer" style="font-size: 17px;"></i></el-button>&nbsp;
							</el-tooltip> -->

							<el-tooltip content="Bottom center" placement="bottom">
								<div slot="content">导出Excel</div>
								<el-button circle size="mini" @click="downloadfile"><i class="el-icon-tickets" style="font-size: 17px;"></i></el-button>
							</el-tooltip>

						</div>
					</div>
				</template>
			</div>
		</div>
		<script type="text/javascript">
			// 获取所有的维修工单
			var repairlist = ${list};
			var pageinfo = ${pageinfo};
		</script>
		<script type="text/javascript">
				/*var Main = {
				data() {
					return {
						activeIndex: '1'
					};
				},
				methods: {
					handleSelect(key, keyPath) {
						console.log(key, keyPath);
					}
				}
			}
			var Ctor = Vue.extend(Main)
			new Ctor().$mount('#app1')*/
		
			var Main = {
				data() {
					return {
						allrepairoptions: [{
							value: '0',
							label: '全部数据'
						}, {
							value: '1431',
							label: '接件'
						}, {
							value: '1433',
							label: '客户确认'
						}, {
							value: '1434',
							label: '开始维修'
						}, {
							value: '1436',
							label: '维修完成'
						} ,{
							value: '1264',
							label: '执行中'
						}, {
							value: '1265',
							label: '结束'
						}, {
							value: '1266',
							label: '意外中止'
						}],
						selectValue: '',
						gdID: '',
					}
				},
				methods: {
					//根据选项获取表单数据
					getSelectRepairInfo(){
						//页大小
						var pageSize= Max.pasSize;
						//查询条件状态
						var statueID=null;
						//工单编号
						var search=null;
						//表单对象
						var MainFromnew= MainFrom;
						console.log("搜索数据："+this.selectValue.toString());
						if(this.selectValue.toString()== "0" ){
							window.location.hash='#/aftersale/repair';
							//showAtRight('/aftersale/repair');
						}else{
							window.location.hash='#/aftersale/repair?statueID='+this.selectValue;
							//showAtRight('/aftersale/repair?statueID='+this.selectValue);
							statueID=this.selectValue;
						}
						this.gdID='';
						$.ajax({
								type: "post",
								url: "/aftersale/repairNew",
								data: {pageNum:1,pageSize:pageSize,statueID:statueID,search:search},
								success: function (getPage) {
										console.log("页数："+JSON.stringify(getPage));
										MainFromnew.repairtable=getPage.list;
										MainFromnew.pages=getPage;
										MainFromnew.currentPage4=getPage.pageNum;
								}
						});
					},
					//根据工单编号搜索
					searchgdId(){
						//页大小
						var pageSize= Max.pasSize;
						//查询条件状态
						var statueID=null;
						//工单编号
						var search=null;
						//表单对象
						var MainFromnew= MainFrom;
						var MainTwoNew=MainTwo;
						console.log(this.selectValue.toString());
						console.log("工单编号:"+this.gdID.toString());
						//判断是否根据条件筛选
						if(this.selectValue.toString()=='0'||this.selectValue.toString()==''){
							if(this.gdID==""){
								window.location.hash='#/aftersale/repair'
								//showAtRight('/aftersale/repair');
							}
							else{
								window.location.hash='#/aftersale/repair?search='+this.gdID;
								//showAtRight('/aftersale/repair?search='+this.gdID);
								search=this.gdID;
							}
						}else{
							statueID=this.selectValue;
							//alert(window.location.hash);
							if(this.gdID==""){
								window.location.hash=window.location.hash.split('&')[0];
								//showAtRight(window.location.hash.split('&')[0].substring(1));
							}
							else{
								window.location.hash=window.location.hash.split('&')[0]+'&search='+this.gdID;
								//showAtRight(window.location.hash.split('&')[0].substring(1)+'&search='+this.gdID);
								search=decodeURI(this.gdID);
							}
						}
						$.ajax({
								type: "post",
								url: "/aftersale/repairNew",
								data: {pageNum:1,pageSize:pageSize,statueID:statueID,search:search},
								success: function (getPage) {
										console.log("页数："+JSON.stringify(getPage));
										MainFromnew.repairtable=getPage.list;
										MainFromnew.pages=getPage;
										MainTwoNew.getNewPage=getPage;
										MainFromnew.currentPage4=getPage.pageNum;
								}
						});
					},/* //重置表单
				resetForm(formName) {
	        this.$refs[form].resetFields();
	      }	
				}, */
				/* mounted() {
				this.loadAll();
				    }, */
					mounted:function(){
						var url= window.location.href;
						var url1= url.indexOf("?");
						if(url1!=-1){
							//截取每一个条件
							var urlcondition= url.substring(url1+1,url.length).split('&');
							for(var i=0;i<urlcondition.length;i++){
								
								if(urlcondition[i].split('=')[0]=="statueID"){
									this.selectValue=decodeURI(urlcondition[i].split('=')[1]);
								}
								if(urlcondition[i].split('=')[0]=="search"){
									this.gdID=decodeURI(urlcondition[i].split('=')[1]);
								}
							}
						}
					}
				}
			}
			var Ctor = Vue.extend(Main)
			new Ctor().$mount('#app2')
		
		
			/* 遮罩层 */
			var MainTwo = new Vue({
					el:"#app3",
					data:{
						getNewPage:'',
						repform: {
							getPerson: '',
							custid: '',
							contactid: '',
							phone: '',
							gdchlassity: '',
							reptel: '',
							allorders:'',
							proID: '',
							getman: '',
							texterrorDescription:'',
							textcommunication:'',
							radioguarantee:1262,
							alljindu:'',
							rocost:'',
							hasgetcost:'',
							radiostatus:1264,
							roprofit:'',
							gettoday: new Date(),
							gettime: new Date().toLocaleTimeString('chinese', { hour12: false }),
							prosalettoday:'',
							paytoday: new Date(),
							remark:'',
						},
						customer:[],
						customers:[],
						firsgettman:[],
						firsgettmans:[],
						cclassify:[],
						cclassifies:[],
						allcontact:[],
						allcontacts:[],
						allgdchlassity: [],
						allgdchlassitys: [],
						proIDoption: [],
						proIDoptions: [],
						getmanoption: [],
						getmanoptions: [],
						alljinduoption: [],
						alljinduoptions: [],
						addcusttel:[],
						addcontel:[],
						allproOrder:[],
						allproOrders:[],
						saleDate:[],
						dialogFormVisible: false,
						cumloading:false,
						centerDialogVisible:false,
						reprules: {
							custid: [{required: true,message: '请选择对应客户',trigger: 'change'},{required: true,message: '请选择对应客户',trigger: 'blur'}],
							allorders:[{required: true,message: '请选择对应订单',trigger: 'change'},{required: true,message: '请选择对应订单',trigger: 'blur'}],
							proID: [{required: true,message: '请选择维修产品',trigger: 'change'},{required: true,message: '请选择维修产品',trigger: 'blur'}],
							radiostatus:[{required: true,message: '请选择状态',trigger: 'change'},{required: true,message: '请选择状态',trigger: 'chablurnge'}]
						},
						/* 销售日期选择 */
						pickerOptions1: {
							disabledDate(time) {
								return time.getTime() > Date.now();
							},
							shortcuts: [{
								text: '今天',
								onClick(picker) {
									picker.$emit('pick', new Date());
								}
							}, {
								text: '昨天',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() - 3600 * 1000 * 24);
									picker.$emit('pick', date);
								}
							}, {
								text: '一周前',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
									picker.$emit('pick', date);
								}
							}]
						},
						/* 交付日期选择 */
						pickerOptions: {
							disabledDate(time) {
								return time.getTime() < Date.now();
							},
							shortcuts: [{
								text: '今天',
								onClick(picker) {
									picker.$emit('pick', new Date());
								}
							}, {
								text: '明天',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() + 3600 * 1000 * 24);
									picker.$emit('pick', date);
								}
							}, {
								text: '一周后',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
									picker.$emit('pick', date);
								}
							}]
						},
					},
					methods:{
						//获取数据（新建打开遮罩层）
						getNew(){
							var _this=this;
							this.dialogFormVisible=true;
							axios.post("/aftersale/chooseAllRepairOptions",
									//id:
									//ajax请求成功的回调函数
								).then(function(v) {
									console.log("回调成功，获取了服务器端返回的值v");
									console.log(v.data);
									//获取接单人
									_this.firsgettman= v.data.getPerson.map(item => {
										return { value: item.ID, label: item.name };
									});
									_this.firsgettmans=_this.firsgettman;
									//获取客户
									_this.customers= v.data.custid.map(item => {
										return { value: item.ID, label: item.name };
									});
									_this.customer=_this.customers;
									//alert(v.data.custid);
									//alert(_this.addcusttel);
									//把客户信息给新对象
									_this.addcusttel=v.data.custid;
									//获取工单分类
									_this.allgdchlassitys=v.data.classityRepair.map(item =>{
										return { value: item.dictId, label: item.dictName };
									});
									_this.allgdchlassity=_this.allgdchlassitys;
									//console.log("所有工单分类");
									//console.log(_this.allgdchlassity);
									//获取产品
									/* _this.proIDoptions=v.data.allProduce.map(item =>{
										return { value: item.ID, label: item.name };
									}); */
									_this.proIDoption=_this.proIDoptions;
									//获取维修人
									_this.getmanoptions=v.data.workerName.map(item =>{
										return { value: item.ID, label: item.name };
									});
									_this.getmanoption=_this.getmanoptions;
									//获取进度
									//获取工单分类
									_this.alljinduoptions=v.data.progressStatue.map(item =>{
										return { value: item.dictId, label: item.dictName };
									});
									_this.alljinduoption=_this.alljinduoptions;
									//获取当前登录用户
									_this.repform.getPerson=v.data.user.uId;
									//默认维修工单进度为接件
									//console.log("工单进度");
									//console.log(v.data.progressStatue.dictId);
									//_this.repform.alljindu=v.data.progressStatue.dictId;
									
								})/*.catch(function() {
									alert("出错了");
								})*/;
						},
						//是否收费（点击保修状态）
						chooseProOne(){
							if (this.repform.radioguarantee==1261) {
								//alert("隐藏");
								//产品保修 隐藏收费控件
								document.getElementById("prodisable").style.display="none";
							} else {
								//alert("显示");
								//产品保修 显示收费控件
								document.getElementById("prodisable").style.display="inline";
							}
						},
						//获取所有产品订单明细表信息
						getOrdersMethod(query){
							var _this=this;
									if (query !== '') {
										this.cumloading = true;
										setTimeout(() => {
											this.cumloading = false;
											this.allproOrder = _this.allproOrders.filter(item => {
												return item.label.toLowerCase()
													.indexOf(query.toLowerCase()) > -1;
											});
										}, 200);
									} else {
										this.uosign = [];
									}
						},
						//获取所有进度
						getJInduMethod(query){
							var _this=this;
									if (query !== '') {
										this.cumloading = true;
										setTimeout(() => {
											this.cumloading = false;
											this.alljinduoption = _this.alljinduoptions.filter(item => {
												return item.label.toLowerCase()
													.indexOf(query.toLowerCase()) > -1;
											});
										}, 200);
									} else {
										this.uosign = [];
									}
						},
						//加载界面客户
						cumremoteMethod(query) {
							var _this=this;
									if (query !== '') {
										this.cumloading = true;
										setTimeout(() => {
											this.cumloading = false;
											this.customer = _this.customers.filter(item => {
												return item.label.toLowerCase()
													.indexOf(query.toLowerCase()) > -1;
											});
										}, 200);
									} else {
										this.uosign = [];
									}
								},
							//清空客户及对应信息
							comcustidto(){
							var _this=this;
							_this.customer=_this.customers;
							_this.repform.phone='';
							_this.repform.contactid='';
							_this.repform.reptel='';
							_this.repform.allorders='';
							_this.repform.proID='';
							_this.repform.prosalettoday='';
							
						},
						//清空联系人及对应信息
							comcontidto(){
								var _this=this;
								_this.allcontact=_this.allcontacts;
								_this.repform.contactid='';
								_this.repform.reptel='';
							},
							//清空订单及对应产品信息
							comallordersto(){
								var _this=this;
								_this.allproOrder=_this.allproOrders;
								_this.repform.allorders='';
								_this.repform.proID='';
								_this.repform.prosalettoday='';
							},
							//选择客户查询对应的联系人
							selectOnechange(){
								//选择客户加载联系方式
								var _this=this;
								console.log("addcusttel:");
								console.log(_this);
								//alert(_this);
								_this.addcusttel.map(item =>{
									if (_this.repform.custid==item.ID) {
										_this.repform.phone=item.phone;
									}
								});
								//console.log(_this.repform.custid);
								axios.post("/aftersale/custToSelectInfo",
								Qs.stringify({
								'custid':_this.repform.custid
								}
								,{arrayFormat: 'brackets'})
								).then(function(v){					          				
								console.log("回调成功，获取了服务器端返回的值v");
								console.log(v.data.comcustmanid);
								//获取联系人
								_this.allcontact= v.data.comcustmanid.map(item => {
									return { value: item.ID, label: item.name };
								}); 
									_this.addcontel=v.data.comcustmanid;
								//获取订单明细
									console.log("订单明细");
									console.log(v.data.orderByidInfo);
									_this.allproOrders= v.data.orderByidInfo.map(item => {
									return { value: item.ID, label: item.theme };
									
								}); 
									_this.allproOrder=v.data.orderByidInfo;
								})/*.catch(function(){
									console.log("信息出错了");
								})*/;			
							},
							//选择订单加载对应产品信息
							selectAllorders(){
								var _this=this;
								console.log("订单加载对应产品信息:");
								console.log(_this);
								axios.post("/aftersale/oidToSelectOrderitemsInfo",
								Qs.stringify({
								'oid':_this.repform.allorders
								}
								,{arrayFormat: 'brackets'})
								).then(function(v){					          				
								console.log("订单详情：");
								console.log(v.data.orderitemsInfo);
								//获取订单对应产品信息
								_this.proIDoptions= v.data.orderitemsInfo.map(item => {
									return { value: item.p_id, label: item.p_name };
								}); 
								_this.saleDate=v.data.orderitemsInfo;
								console.log("日期："+JSON.stringify(_this.saleDate));
								})/*.catch(function(){
									console.log("信息出错了");
								})*/;
							},
							//选择联系人加载联系人信息
							addothercon:function(){
								var _this=this;
								_this.addcontel.map(item =>{
									if(_this.repform.contactid==item.ID){
										_this.repform.reptel=item.phone;
									}
								});
							},
							//选择产品加载销售日期
							addDate:function(){
								var _this=this;
								_this.saleDate.map(item =>{
									if(_this.repform.allorders==item.o_id){
										_this.repform.prosalettoday=item.date;
									}
								});
							},
							
							//接单人
							firstmanMethod(query){
								var _this=this;
										if (query !== '') {
											this.cumloading = true;
											setTimeout(() => {
												this.cumloading = false;
												this.firsgettman = _this.firsgettmans.filter(item => {
													return item.label.toLowerCase()
														.indexOf(query.toLowerCase()) > -1;
												});
											}, 200);
										} else {
											this.uosign = [];
										}
							},
							//加载联系人
							contactidMethod(query) {
								var _this=this;
								if (query !== '') {
									this.cumloading = true;
									setTimeout(() => {
										this.cumloading = false;
										this.allcontact = _this.allcontacts.filter(item => {
											return item.label.toLowerCase()
											.indexOf(query.toLowerCase()) > -1;
										});
									}, 200);
								} else {
									this.uosign = [];
								}
							},
							//加载工单分类
							gdchlassityMethod(query){
								var _this=this;
								//console.log(_this);
								if (query !== '') {
									this.cumloading = true;
									setTimeout(() => {
										this.cumloading = false;
										this.allgdchlassity = _this.allgdchlassitys.filter(item => {
											return item.label.toLowerCase()
											.indexOf(query.toLowerCase()) > -1;
										});
									}, 200);
									
								} else {
									this.uosign = [];
								}
							},
							//加载产品
							productidMethod(query){
								var _this=this;
								if (query !== '') {
									this.cumloading = true;
									setTimeout(() => {
										this.cumloading = false;
										this.proIDoption = _this.proIDoptions.filter(item => {
											return item.label.toLowerCase()
											.indexOf(query.toLowerCase()) > -1;
										});
									}, 200);
								} else {
									this.uosign = [];
								}
							},
							//加载维修人
							getmanMethod(query){
								var _this=this;
								if (query !== '') {
									this.cumloading = true;
									setTimeout(() => {
										this.cumloading = false;
										this.getmanoption = _this.getmanoptions.filter(item => {
											return item.label.toLowerCase()
											.indexOf(query.toLowerCase()) > -1;
										});
									}, 200);
								} else {
									this.uosign = [];
								}
							},
							submitForm(repform) {
								//验证方法
								//alert("添加！");
								var _this=this;
								console.log("新建获取信息");
								console.log(this.repform);
								this.$refs[repform].validate((valid) => {
									if (valid) {
										//post提交数据
										axios.post("/aftersale/addrepair",
											//参数转换
											Qs.stringify(this.repform, {
												arrayFormat: 'brackets'
											})
											//id:
											//ajax请求成功的回调函数
										).then(function(v) {
											//console.log("回调成功，获取了服务器端返回的值v");
											//console.log(v);
												_this.$message({
															showClose: true,
												type: 'success',
												message: '添加成功!',
												duration:3000,
												center: true
											});
												//延时两秒刷新
												setTimeout(function (){
													_this.dialogFormVisible=false;
													showAtRight('/aftersale/repair');
												}, 2000);
										}).catch(function() {
											//alert("出错了");
											_this.$message({
												showClose: true,
												type: 'success',
												message: '添加失败!',
												duration:3000,
												center: true
											});
										});
									} else {
										console.log('error submit!!');
										return false;
									}
								});
						},
						resetForm(repform) {
							this.$refs[repform].resetFields();
						}
					}
			})
		
			/*  表单  */
			var MainFrom=new Vue({
				el:"#app4",
				data:{
						repairtable:repairlist,
						repform: {
							ID:'',
							getPerson: '',
							custid: '',
							contactid: '',
							phone: '',
							gdchlassity: '',
							reptel: '',
							allorders:'',
							proID: '',
							getman: '',
							texterrorDescription:'',
							textcommunication:'',
							radioguarantee:1262,
							alljindu:'',
							rocost:'',
							hasgetcost:'',
							radiostatus:'',
							roprofit:'',
							gettoday: '',
							gettime:'',
							prosalettoday:'',
							paytoday: '',
							remark:'',
						},
						customer:[],
						customers:[],
						firsgettman:[],
						firsgettmans:[],
						cclassify:[],
						cclassifies:[],
						allcontact:[],
						allcontacts:[],
						allgdchlassity: [],
						allgdchlassitys: [],
						proIDoption: [],
						proIDoptions: [],
						getmanoption: [],
						getmanoptions: [],
						alljinduoption: [],
						alljinduoptions: [],
						addcusttel:[],
						addcontel:[],
						allproOrder:[],
						allproOrders:[],
						saleDate:[],
						addorder:[],
						multipleSelection: [],
						dialogDelete:false,
						dialogFormVisible: false,
						centerDialogVisible: false,
						cumloading:false,
						pages: pageinfo,
						currentPage4: pageinfo.pageNum,
						reprules: {
							custid: [{required: true,message: '请选择对应客户',trigger: 'change'},{required: true,message: '请选择对应客户',trigger: 'blur'}],
							allorders:[{required: true,message: '请选择对应订单',trigger: 'change'},{required: true,message: '请选择对应订单',trigger: 'blur'}],
							proID: [{required: true,message: '请选择维修产品',trigger: 'change'},{required: true,message: '请选择维修产品',trigger: 'blur'}],
							radiostatus:[{required: true,message: '请选择状态',trigger: 'change'},{required: true,message: '请选择状态',trigger: 'chablurnge'}]
						},
						//是否收费（点击保修状态）
						chooseProOne(){
							if (this.repform.radioguarantee==1261) {
								//alert("隐藏");
								//产品保修 隐藏收费控件
								document.getElementById("prodisable").style.display="none";
							} else {
								//alert("显示");
								//产品保修 显示收费控件
								document.getElementById("prodisable").style.display="inline";
							}
						},
						/* 销售日期选择 */
						pickerOptions1: {
							disabledDate(time) {
								return time.getTime() > Date.now();
							},
							shortcuts: [{
								text: '今天',
								onClick(picker) {
									picker.$emit('pick', new Date());
								}
							}, {
								text: '昨天',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() - 3600 * 1000 * 24);
									picker.$emit('pick', date);
								}
							}, {
								text: '一周前',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
									picker.$emit('pick', date);
								}
							}]
						},
						/* 交付日期选择 */
						pickerOptions: {
							disabledDate(time) {
								return time.getTime() < Date.now();
							},
							shortcuts: [{
								text: '今天',
								onClick(picker) {
									picker.$emit('pick', new Date());
								}
							}, {
								text: '明天',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() + 3600 * 1000 * 24);
									picker.$emit('pick', date);
								}
							}, {
								text: '一周后',
								onClick(picker) {
									const date = new Date();
									date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
									picker.$emit('pick', date);
								}
							}]
						},
				},
				methods:{
						//获取所有进度
						getJInduMethod(query){
							var _this=this;
									if (query !== '') {
										this.cumloading = true;
										setTimeout(() => {
											this.cumloading = false;
											this.alljinduoption = _this.alljinduoptions.filter(item => {
												return item.label.toLowerCase()
													.indexOf(query.toLowerCase()) > -1;
											});
										}, 200);
									} else {
										this.uosign = [];
									}
						},
						//获取所有产品订单明细表信息
						getOrdersMethod(query){
							var _this=this;
									if (query !== '') {
										this.cumloading = true;
										setTimeout(() => {
											this.cumloading = false;
											this.allproOrder = _this.allproOrders.filter(item => {
												return item.label.toLowerCase()
													.indexOf(query.toLowerCase()) > -1;
											});
										}, 200);
									} else {
										this.uosign = [];
									}
						},
						//加载界面客户
						cumremoteMethod(query) {
							var _this=this;
									if (query !== '') {
										this.cumloading = true;
										setTimeout(() => {
											this.cumloading = false;
											this.customer = _this.customers.filter(item => {
												return item.label.toLowerCase()
													.indexOf(query.toLowerCase()) > -1;
											});
										}, 200);
									} else {
										this.uosign = [];
									}
								},
						//清空客户及对应信息
						comcustidto(){
						var _this=this;
						_this.customer=_this.customers;
						_this.repform.phone='';
						_this.repform.contactid='';
						_this.repform.reptel='';
						},
						//清空联系人及对应信息
						comcontidto(){
							var _this=this;
							_this.allcontact=_this.allcontacts;
							_this.repform.contactid='';
							_this.repform.reptel='';
						},
						//清空订单及对应产品信息
						comallordersto(){
							var _this=this;
							_this.allproOrder=_this.allproOrders;
							_this.repform.allorders='';
							_this.repform.proID='';
							_this.repform.prosalettoday='';
						},
						//选择客户查询对应的联系人
						selectOnechange(){
							//选择客户加载联系方式
							var _this=this;
							console.log("addcusttel:");
							console.log(_this);
							//alert(_this);
							_this.addcusttel.map(item =>{
								if (_this.repform.custid==item.ID) {
									_this.repform.phone=item.phone;
								}
							});
							//console.log(_this.repform.custid);
							axios.post("/aftersale/custToSelectInfo",
							Qs.stringify({
							'custid':_this.repform.custid
							}
							,{arrayFormat: 'brackets'})
							).then(function(v){					          				
							console.log("回调成功，获取了服务器端返回的值v");
							console.log(v.data.comcustmanid);
							//获取联系人
							_this.allcontact= v.data.comcustmanid.map(item => {
								return { value: item.ID, label: item.name };
							}); 
								_this.addcontel=v.data.comcustmanid;
							//获取订单明细
								console.log("订单明细：");
								console.log(v.data.orderByidInfo);
								_this.allproOrders= v.data.orderByidInfo.map(item => {
								return { value: item.ID, label: item.theme };
							}); 
								_this.allproOrder=v.data.orderByidInfo;
							})/*.catch(function(){
								console.log("信息出错了");
							})*/;			
						},
						//选择订单加载对应产品信息
						selectAllorders(){
							var _this=this;
							console.log("订单加载对应产品信息:");
							console.log(_this);
							axios.post("/aftersale/oidToSelectOrderitemsInfo",
							Qs.stringify({
							'oid':_this.repform.allorders
							}
							,{arrayFormat: 'brackets'})
							).then(function(v){					          				
							console.log("订单详情：");
							console.log(v.data.orderitemsInfo);
							//获取订单对应产品信息
							_this.proIDoptions= v.data.orderitemsInfo.map(item => {
								return { value: item.p_id, label: item.p_name };
							}); 
							_this.saleDate=v.data.orderitemsInfo;
							console.log("日期："+JSON.stringify(_this.saleDate));
							})/*.catch(function(){
								console.log("信息出错了");
							})*/;
						},
						//选择联系人加载联系人信息
						addothercon:function(){
							var _this=this;
							_this.addcontel.map(item =>{
								if(_this.repform.contactid==item.ID){
									_this.repform.reptel=item.phone;
								}
							});
						},
						//选择产品加载销售日期
						addDate:function(){
							var _this=this;
							_this.saleDate.map(item =>{
								if(_this.repform.allorders==item.o_id){
									_this.repform.prosalettoday=item.date;
								}
							});
						},
						//接单人
						firstmanMethod(query){
							var _this=this;
									if (query !== '') {
										this.cumloading = true;
										setTimeout(() => {
											this.cumloading = false;
											this.firsgettman = _this.firsgettmans.filter(item => {
												return item.label.toLowerCase()
													.indexOf(query.toLowerCase()) > -1;
											});
										}, 200);
									} else {
										this.uosign = [];
									}
						},
						//加载联系人
						contactidMethod(query) {
							var _this=this;
							if (query !== '') {
								this.cumloading = true;
								setTimeout(() => {
									this.cumloading = false;
									this.allcontact = _this.allcontacts.filter(item => {
										return item.label.toLowerCase()
										.indexOf(query.toLowerCase()) > -1;
									});
								}, 200);
							} else {
								this.uosign = [];
							}
						},
						//加载工单分类
						gdchlassityMethod(query){
							var _this=this;
							//console.log(_this);
							if (query !== '') {
								this.cumloading = true;
								setTimeout(() => {
									this.cumloading = false;
									this.allgdchlassity = _this.allgdchlassitys.filter(item => {
										return item.label.toLowerCase()
										.indexOf(query.toLowerCase()) > -1;
									});
								}, 200);
								
							} else {
								this.uosign = [];
							}
						},
						//加载产品
						productidMethod(query){
							var _this=this;
							if (query !== '') {
								this.cumloading = true;
								setTimeout(() => {
									this.cumloading = false;
									this.proIDoption = _this.proIDoptions.filter(item => {
										return item.label.toLowerCase()
										.indexOf(query.toLowerCase()) > -1;
									});
								}, 200);
							} else {
								this.uosign = [];
							}
						},
						//加载维修人
						getmanMethod(query){
							var _this=this;
							if (query !== '') {
								this.cumloading = true;
								setTimeout(() => {
									this.cumloading = false;
									this.getmanoption = _this.getmanoptions.filter(item => {
										return item.label.toLowerCase()
										.indexOf(query.toLowerCase()) > -1;
									});
								}, 200);
							} else {
								this.uosign = [];
							}
						},
						//打开编辑工单遮罩层
						updatehandleClick(row) {
								var _this = this;
								var id= row;
								//alert(_this);
								axios.post("/aftersale/repairOne",
									Qs.stringify( {
												'ID':row.ID,
										},{arrayFormat: 'brackets'}) 
				
								).then(function(v) {
									console.log("回调成功，获取了服务器端返回的值v");
									console.log(v.data.allProduce);
									//获取接单人
									_this.firsgettman= v.data.getPerson.map(item => {
										return { value: item.ID, label: item.name };
									});
									_this.firsgettmans=_this.firsgettman;
									//获取客户
									_this.customer= v.data.custid.map(item => {
										return { value: item.ID, label: item.name };
									});
									_this.customers=_this.customer;
									//alert(_this.addcusttel);
									//把客户信息给新对象
									_this.addcusttel=v.data.custid;
									//获取所有订单信息
									_this.allproOrders=v.data.orderByidInfo.map(item => {
										return { value: item.ID, label: item.theme };
									});
										_this.allproOrder=_this.allproOrders;
									//获取客户对应联系人
									_this.allcontact= v.data.contract.map(item => {
										return { value: item.ID, label: item.name };
									});
									_this.allcontacts=_this.allcontact;
									//获取工单分类
									_this.allgdchlassitys=v.data.classityRepair.map(item =>{
										return { value: item.dictId, label: item.dictName };
									});
									_this.allgdchlassity=_this.allgdchlassitys;
									console.log("所有工单分类");
									console.log(_this.allgdchlassity);
									//获取产品
									_this.proIDoptions=v.data.allProduce.map(item =>{
										return { value: item.ID, label: item.name };
									});
									console.log("AAAAAAA："+JSON.stringify(_this.proIDoptions));
									_this.proIDoption=_this.proIDoptions;
									//获取维修人
									_this.getmanoptions=v.data.workerName.map(item =>{
										return { value: item.ID, label: item.name };
									});
									_this.getmanoption=_this.getmanoptions;
									//获取工单分类
									_this.alljinduoptions=v.data.progressStatue.map(item =>{
										return { value: item.dictId, label: item.dictName };
									});
									_this.alljinduoption=_this.alljinduoptions;
									//传值
									console.log("单条工单所有信息：");
									console.log(v.data.repair);
									_this.repform.ID=v.data.repair.ID;
									_this.repform.getPerson=v.data.repair.getPerson;
									_this.repform.gettoday=v.data.repair.getDate;
									_this.repform.custid=v.data.repair.custid;
									_this.repform.gettime=v.data.repair.getTime;
									_this.repform.phone=v.data.repair.phone;
									_this.repform.contactid=v.data.repair.conid;
									_this.repform.reptel=v.data.repair.contel;
									_this.repform.gdchlassity=v.data.repair.classify;
									_this.repform.allorders=v.data.repair.roOrderid;
									_this.repform.proID=parseInt(v.data.repair.goodId);
									_this.repform.getman=v.data.repair.worker;
									_this.repform.prosalettoday=v.data.repair.getDate;
									_this.repform.alljindu=v.data.repair.schedule;
									_this.repform.texterrorDescription=v.data.repair.errorDescription;
									_this.repform.textcommunication=v.data.repair.communication;
									_this.repform.radioguarantee=v.data.repair.guarantee;
									_this.repform.rocost=v.data.repair.cost;
									_this.repform.hasgetcost=v.data.repair.getCost;
									_this.repform.radiostatus=v.data.repair.rosatus;
									_this.repform.paytoday=v.data.repair.payDate;
									_this.repform.remark=v.data.repair.remark;
									
								})/* .catch(function() {
									alert("出错了");
								} )*/;
								//this.selectOnechange();
								this.dialogFormVisible = true;
							},
						//表单提交
						submitForm(repform) {
							//验证方法
							//alert("添加！");
							var _this=this;
							console.log("修改获取信息！");
							console.log(this.repform);
							this.$refs[repform].validate((valid) => {
								if (valid) {
									//post提交数据
									axios.post("/aftersale/updaterepair",
										//参数转换
										Qs.stringify(this.repform, {
											arrayFormat: 'brackets'
										})
										//id:
										//ajax请求成功的回调函数
									).then(function(v) {
										console.log("回调成功，获取了服务器端返回的值v");
										console.log(v);
											_this.$message({
														showClose: true,
											type: 'success',
											message: '修改成功!',
											duration:3000,
											center: true
										});
												//延时两秒刷新
												setTimeout(function (){
													_this.dialogFormVisible=false;
													showAtRight('/aftersale/repair');
												}, 2000);
									}).catch(function() {
										//alert("出错了");
										_this.$message({
														showClose: true,
											type: 'success',
											message: '修改失败!',
											duration:3000,
											center: true
										});
									});
								} else {
									console.log('error submit!!');
									return false;
								}
							});
						},
						resetForm(repform) {
							this.$refs[repform].resetFields();
						},
						//打开编辑工单遮罩层
						/* updatehandleClick(row) {
							this.dialogFormVisible = true;
						}, */
						//打开维修工单视图
						openrepairView(row){
							window.open("/aftersale/openRepairView?id="+row.ID);
						},
						handleClick(row) {
							console.log(row);
						},
						handleSelectionChange(val) {
							this.multipleSelection = val;
						},
						
						handleSizeChange(val) {
							//页大小
							Max.pasSize= val;
							//查询条件状态
							var statueID=null;
							//工单编号
							var search=null;
							var MainFromnew = MainFrom;
							var MainTwoNew=MainTwo;
							//判断是否带条件;
							var url= window.location.href;
							var url1= url.indexOf("?");
							if(url1!=-1){
								//截取条件
								var urlcondition= url.substring(url1+1,url.length).split('&');
								for(var i=0;i<urlcondition.length;i++){
									
									if(urlcondition[i].split('=')[0]=="statueID"){
										statusid=decodeURI(urlcondition[i].split('=')[1]);
									}
									if(urlcondition[i].split('=')[0]=="search"){
										search=decodeURI(urlcondition[i].split('=')[1]);
									}
								}
							}
							$.ajax({
									type: "post",
									url: "/aftersale/repairNew",
									data: {pageNum:1,pageSize:val,statueID:statueID,search:search},
									success: function (getPage) {
											console.log("页数："+JSON.stringify(getPage));
											MainFromnew.repairtable=getPage.list;
											MainFromnew.pages=getPage;
											MainTwoNew.getNewPage=getPage;
											MainFromnew.currentPage4=getPage.pageNum;
									}
							});
						},
						handleCurrentChange(val) {
							//页大小
							var pageSize= Max.pasSize;
							//查询条件状态
							var statueID=null;
							//工单编号
							var search=null;
							var MainFromnew = MainFrom;
							//判断是否带条件;
							var url= window.location.href;
							var url1= url.indexOf("?");
							if(url1!=-1){
								//截取条件
								var urlcondition= url.substring(url1+1,url.length).split('&');
								for(var i=0;i<urlcondition.length;i++){
									
									if(urlcondition[i].split('=')[0]=="statueID"){
										statusid=decodeURI(urlcondition[i].split('=')[1]);
									}
									if(urlcondition[i].split('=')[0]=="search"){
										search=decodeURI(urlcondition[i].split('=')[1]);
									}
								}
							}
							$.ajax({
									type: "post",
									url: "/aftersale/repairNew",
									data: {pageNum:1,pageSize:pageSize,statueID:statueID,search:search},
									success: function (getPage) {
											console.log("页数："+JSON.stringify(getPage));
											MainFromnew.repairtable=getPage.list;
											MainFromnew.pages=getPage;
											MainFromnew.currentPage4=getPage.pageNum;
									}
							});
						},
						deletenew(ID){
							this.ID=ID;
							this.dialogDelete=true;
						},
						//删除方法
						Delete(){
							var _this=this;
							axios.get("/aftersale/deleteOneRepair",
									{
										params:{
										ID:_this.ID
										}
									}).then(function(response){					          				
										console.log("回调成功，获取了服务器端返回的值v");
										console.log(response.data);					           		
										_this.restaurants=response.data;
										console.log(response.data.RoStatus);
										console.log(response.data.RoSchedule);
										/*  && response.data.RoSchedule!=1265 */
										if (response.data.RoSchedule!=1436) {
											_this.$message({
													showClose: true,
										type: 'error',
										message: '工单未结束!删除失败!',
										duration:3000,
										center: true
								});
								} else {
									//alert("删除成功！");
										_this.$message({
										showClose: true,
										type: 'success',
										message: '删除成功!',
										duration:3000,
										center: true
									});
									//延时两秒刷新
									setTimeout(function (){
										showAtRight('/aftersale/repair');
									}, 2000);
									}
									}).catch(function(){
										//alert("删除失败！");
										_this.$message({
										type: 'error',
										message: '删除失败!',
										duration:3000,
										center: true
									});
								});	//这个是数据的初始化
							},
						//导出Excel表格
						downloadfile(){
							window.location.href ="/aftersale/RepairExcelDownloads";
						},
						//表单提交修改
						submitForm(repform) {
							//验证方法
							//alert("修改！");
							var _this=this;
							this.$refs[repform].validate((valid) => {
								if (valid) {
									//post提交数据
									axios.post("/aftersale/updaterepair",
										//参数转换
										Qs.stringify(this.repform, {
											arrayFormat: 'brackets'
										})
										//id:
										//ajax请求成功的回调函数
									).then(function(v) {
										console.log("回调成功，获取了服务器端返回的值v");
										console.log(v);
											_this.$message({
														showClose: true,
											type: 'success',
											message: '修改成功!',
											duration:3000,
											center: true
										});
													//延时两秒刷新
													setTimeout(function (){
														_this.dialogFormVisible=false;
														showAtRight('/aftersale/repair');
													}, 2000);
									}).catch(function() {
										//alert("出错了");
										_this.$message({
														showClose: true,
											type: 'success',
											message: '修改失败!',
											duration:3000,
											center: true
										});
									});
								} else {
									console.log('error submit!!');
									return false;
								}
							});
						},
						resetForm(repform) {
								this.$refs[repform].resetFields();
						}
				}
			})
			
		</script>
	</body>
</html>
